﻿SendMessageWait = {};

SendMessageWait.times = 60;//倒计时60秒

SendMessageWait.settime = function (val) {
	this.times--;
	val.val("等待(" + this.times + ")");
	val.attr("disabled", "disabled");
	val.removeClass("buttonSend");
	val.addClass("buttonSendWait");
	if (this.times == 0) {
		val.val("发送");
		val.attr("disabled", false);
		val.addClass("buttonSend");
		val.removeClass("buttonSendWait");
		this.times = 60;
	} else {
		setTimeout(function () {
			SendMessageWait.settime(val)
		}, 1000)
	}

}